%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Alamanac Data File %
%   Author: Saurav Agarwal   
%   Email:  saurav6@gmail.com
%   Date:   January 1, 2011  
%   Place:  Dept. of Aerospace Engg., IIT Bombay, Mumbai, India 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   From http://www.navcen.uscg.gov/?pageName=gpsAlmanacs (data taken from site on 11th Oct, 2010) GPS Week 581 %
%   This file contains the alamanac data obtained for all 31 satellites %
%   We will use this file to load ephemris data %
%   for satellite position calculation %
%   We will use array structure to store the data %
%   the structure is of type (ephemeris reference time (s), eccentricity, %
%   inclination(rad), rate of right ascension(rad/s), sqrt(semi-major-axis in meter), right %
%   ascension at week(rad), argperigee (rad), mean anomaly (rad), af0, af1) %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%
% sv : space vehicle %

function [gps_sat] = gps_alamanac_data();
    sv1 = struct('e',0.9717941284E-002,'i_0',0.9399662018,'Omega_dot', -0.7930793799E-008,'sqrt_a', 5153.591797,'Omega_0',0.3129077792E+001,'omega',3.140386343,'M_0',0.1648490429E+001,'af0',0.2946853638E-003,'af1',0.3637978807E-011);

    sv2 = struct('e',0.1375055313E-001,'i_0',0.9274730682,'Omega_dot',-0.8283677744E-008,'sqrt_a', 5153.542969,'Omega_0',0.1974781156e+001,'omega',1.046698451,'M_0',0.1529784799E+001,'af0',0.6198883057E-003,'af1',0.3637978807E-011);

    sv3 = struct('e',0.9379386902E-002,'i_0',0.9390869141,'Omega_dot',-0.7927155821E-008,'sqrt_a', 5153.706055,'Omega_0', -0.3136425257E+001,'omega', 0.654833794,'M_0',-0.1631534219E+001,'af0',0.1916885376E-003,'af1',0.1091393642E-010);

    sv4 = struct('e',0.1934528351E-002,'i_0', 0.9566497803,'Omega_dot',-0.7898051990E-008,'sqrt_a', 5153.491211,'Omega_0',-0.2093719006E+001,'omega', 0.150305748,'M_0',-0.2951365232E+001,'af0', -0.4959106445E-004,'af1',-0.7275957614E-011);

    sv5 = struct('e',0.6158351898E-002,'i_0', 0.9347667694,'Omega_dot',-0.8218194125E-008,'sqrt_a', 5153.587402,'Omega_0',0.2046554685E+001,'omega', -0.937443852,'M_0',-0.2582926273E+001,'af0', 0.4596710205E-003,'af1',-0.1455191523E-010);

    sv6 = struct('e',0.4140377045E-002,'i_0', 0.9731807709,'Omega_dot',-0.7818016456E-008,'sqrt_a', 5153.645996,'Omega_0',0.8900165558E-002,'omega', 3.116469979,'M_0',-0.4353499413E-001,'af0', -0.1907348633E-005,'af1',0.0000000000E+000);

    sv7 = struct('e',0.1152896881E-001,'i_0', 0.9946689606,'Omega_dot',-0.7556081982E-008,'sqrt_a', 5153.620117,'Omega_0',0.7961344719E-001,'omega', -3.134567976,'M_0',-0.6259098053E+000,'af0', 0.6675720215E-005,'af1',0.0000000000E+000);

    sv8 = struct('e',0.1700687408E-001,'i_0', 0.9822177887,'Omega_dot',-0.7748894859E-008,'sqrt_a', 5153.659668,'Omega_0',-0.2124357224E-001,'omega',1.552435040,'M_0',-0.7527018785E+000,'af0',  0.3623962402E-004,'af1',0.3637978807E-011);

    sv9 = struct('e',0.9441375732E-002,'i_0', 0.9516220093,'Omega_dot',-0.7956259651E-008,'sqrt_a', 5153.479004,'Omega_0',-0.2068731189E+001,'omega',0.662930965,'M_0',-0.2810052395E+001,'af0',  -0.5531311035E-004,'af1', 0.0000000000E+000);

    sv10 = struct('e',0.1132488251E-001,'i_0', 0.8885612488,'Omega_dot',-0.8516508387E-008,'sqrt_a', 5153.701660,'Omega_0',0.2903643250E+001,'omega',0.854365110,'M_0',-0.1704478264E+000,'af0',  -0.9536743164E-004,'af1', -0.3637978807E-011);

    sv11 = struct('e',0.3305435181E-002,'i_0',  0.9721927643,'Omega_dot',-0.7632479537E-008,'sqrt_a', 5153.544434,'Omega_0',0.1062735558E+001,'omega',-0.324701667,'M_0',-0.4612469673E-001,'af0',  -0.6484985352E-004,'af1', 0.3637978807E-011);

    sv12 = struct('e', 0.4311084747E-002,'i_0',  0.9916305542,'Omega_dot',-0.7916241884E-008,'sqrt_a', 5153.650879,'Omega_0',-0.9695185423E+000,'omega',1.808801174,'M_0',0.2388894558E+001,'af0', 0.2956390381E-003,'af1',  0.0000000000E+000);

    sv13 = struct('e', 0.5702972412E-002,'i_0',  0.9847888947,'Omega_dot',-0.7989001460E-008,'sqrt_a', 5153.534668,'Omega_0',-0.9922137260E+000,'omega',-2.112283349,'M_0',0.2341084242E+001,'af0', 0.9727478027E-004,'af1', 0.3637978807E-011);

    sv14 = struct('e', 0.2831935883E-002,'i_0',  0.9521846771,'Omega_dot',-0.8305505617E-008,'sqrt_a', 5153.774414,'Omega_0', -0.1060687423E+001,'omega', -0.210268855,'M_0',0.2191159725E+001,'af0',-0.1974105835E-003,'af1', 0.3637978807E-011);

    sv15 = struct('e', 0.5815982819E-002,'i_0', 0.9733123779,'Omega_dot',-0.7657945389E-008,'sqrt_a', 5153.625000,'Omega_0', 0.1080329537E+001,'omega',  -0.160482645,'M_0', -0.2377792358E+001,'af0',-0.1163482666E-003,'af1', -0.3637978807E-011);

    sv16 = struct('e', 0.5634307861E-002,'i_0', 0.9603576660,'Omega_dot',-0.7941707736E-008,'sqrt_a', 5153.605957,'Omega_0', 0.2123745799E+001,'omega',  -2.512104392,'M_0', 0.2874350429E+001,'af0',0.1735687256E-003,'af1', 0.0);

    sv17 = struct('e',   0.1185274124E-001,'i_0', 0.9355697632,'Omega_dot', -0.8072674973E-008,'sqrt_a', 5153.682617,'Omega_0', -0.2070865870E+001,'omega',  -2.287830114,'M_0',-0.2064763665E+001,'af0',0.9822845459E-004,'af1',0.3637978807E-011);

    sv18 = struct('e',  0.6700038910E-002,'i_0', 0.9579792023,'Omega_dot', -0.7963535609E-008,'sqrt_a', 5153.515137,'Omega_0', 0.2178431392E+001,'omega', -0.045089126,'M_0', 0.2020302892E+001,'af0',-0.7343292236E-004,'af1',-0.3637978807E-011);

    sv19 = struct('e',  0.4257202148E-002,'i_0', 0.9356040955,'Omega_dot', -0.8076312952E-008,'sqrt_a', 5153.761719,'Omega_0',  -0.2124836087E+001,'omega', 1.266663313,'M_0', -0.1680142999E+001,'af0',0.5054473877E-004,'af1',0);

    sv20 = struct('e', 0.1688814163E-001,'i_0', 0.9326629639,'Omega_dot', -0.8036295185E-008,'sqrt_a', 5153.568848,'Omega_0', -0.3126577973E+001,'omega', -2.439979553,'M_0', -0.8855537176E+000,'af0',-0.9441375732E-004,'af1',-0.3637978807E-011);

    sv21 = struct('e', 0.5580425262E-002,'i_0',  0.9332618713,'Omega_dot', -0.8116330719E-008,'sqrt_a', 5153.667969,'Omega_0', -0.2066244841E+001,'omega', -1.927601099,'M_0',  -0.2963628054E+001,'af0',0.1611709595E-003,'af1',0);

    sv22 = struct('e', 0.6992340088E-002,'i_0',  0.9665241241,'Omega_dot', -0.8159986464E-008,'sqrt_a', 5153.583984,'Omega_0', -0.1033619881E+001,'omega', 3.114451051,'M_0',  0.1576552153E+001,'af0',0.3490447998E-003,'af1',-0.3637978807E-011);

    sv23 = struct('e', 0.5754470825E-002,'i_0',  0.9492797852,'Omega_dot', -0.7799826562E-008,'sqrt_a', 5154.707520,'Omega_0', -0.3085681319E+001,'omega', -0.359179974,'M_0', 0.1618582249E+001,'af0',0.3290176392E-003,'af1', 0.3637978807E-011);

    sv24 = struct('e',0.7176399231E-003,'i_0', 0.9609222412,'Omega_dot', -0.7752532838E-008,'sqrt_a', 5153.712891,'Omega_0', 0.1035565853E+001,'omega', 1.971091509,'M_0', -0.2850866199E+001,'af0',-0.4482269287E-004,'af1', -0.3637978807E-011);

    sv25 = struct('e',0.1984405518E-001,'i_0', 0.9893188477,'Omega_dot', -0.7959897630E-008,'sqrt_a', 5153.595215,'Omega_0', -0.9734778404E+000,'omega', 1.112707138,'M_0',  0.1301463962E+001,'af0',-0.2765655518E-004,'af1',-0.7275957614E-011);

    sv26 = struct('e',0.2162837982E-001,'i_0', 0.9798450470,'Omega_dot', -0.7734342944E-008,'sqrt_a', 5153.530273,'Omega_0',  -0.4657363892E-001,'omega', -1.363448977,'M_0',   0.2437499166E+001,'af0',0.1974105835E-003,'af1',0.3637978807E-011);

    sv27 = struct('e',0.1626777649E-001,'i_0',0.9715690613,'Omega_dot', -0.7668859325E-008,'sqrt_a',5153.635254,'Omega_0',  0.1087866545E+001,'omega', -1.944749475,'M_0',   -0.2811243415E+001,'af0',0,'af1',0);

    sv28 = struct('e',0.2580642700E-002,'i_0',0.9607295990,'Omega_dot', -0.7938069757E-008,'sqrt_a',5153.591797,'Omega_0', 0.2132056952E+001,'omega', -1.248912454,'M_0',  -0.7631899118E+000,'af0',0.1554489136E-003,'af1',0.3637978807E-011);

    sv29 = struct('e',0.1312303543E-001,'i_0',0.9575901031,'Omega_dot', -0.7763446774E-008,'sqrt_a',5155.299805,'Omega_0', 0.1007025003E+001,'omega', 1.551597953,'M_0',  -0.2585166574E+001,'af0',0.2861022949E-003,'af1',0.3637978807E-011);

    sv30 = struct('e',0.7449150085E-002,'i_0',0.9784011841,'Omega_dot',-0.7767084753E-008,'sqrt_a',5153.737305,'Omega_0',  0.9124159813E-002,'omega', -1.052870393,'M_0',   -0.5640900135E-001,'af0',-0.1907348633E-005,'af1',0.3637978807E-011);

    sv31 = struct('e',0.1267480850E-001,'i_0',0.9573802948,'Omega_dot', -0.7901689969E-008,'sqrt_a',5153.561523,'Omega_0',  -0.2004679561E+001,'omega', -0.917668819,'M_0',  0.7545526028E+000,'af0', -0.1058578491E-003,'af1',-0.7275957614E-011);

    sv32 = struct('e',1.521692e-2,'i_0',9.464037e-1,'Omega_dot', -8.464281e-9,'sqrt_a',5.153688e+003,'Omega_0',  1.384688,'omega', -2.466272,'M_0',  -3.682930e-1,'af0', -2.502208e-4,'af1',-3.183231e-12);
    % sv32 is test value taken from grewals matlab file

    % Consolidate all these arrars into 1 array called  gps_sat %
    gps_sat = [sv1,sv2,sv3,sv4,sv5,sv6,sv7,sv8,sv9,sv10,sv11,sv12,sv13,sv14,sv15,sv16,sv17,sv18,sv19,sv20,sv21,sv22,sv23,sv24,sv25,sv26,sv27,sv28,sv29,sv30,sv31,sv32];
end